dataSource {
    pooled = true
    logSql = true
    driverClassName = "com.mysql.jdbc.Driver"
}
hibernate {
    cache.use_second_level_cache = true
    cache.use_query_cache = false
    cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3
//    cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4
}

environments {
    development {
        dataSource {
            dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', ''

            username = "root"
            password = "mysql"
            url = "jdbc:mysql://192.168.1.108/traininfo?useUnicode=true&characterEncoding=utf8"
        }

        /* dataSource {
             dbCreate = "update"
             username = "admin"
             password = "12345678"
 //            url = "jdbc:mysql://10.162.211.53/traininfo?useUnicode=true&characterEncoding=utf8"
             url = "jdbc:mysql://192.168.1.188/traininfo?useUnicode=true&characterEncoding=utf8"
             properties {
                 maxActive = -1
                 minEvictableIdleTimeMillis = 1800000
                 timeBetweenEvictionRunsMillis = 1800000
                 numTestsPerEvictionRun = 3
                 testOnBorrow = true
                 testWhileIdle = true
                 testOnReturn = false
                 validationQuery = "SELECT 1"
                 jdbcInterceptors = "ConnectionState"
             }
         }*/
    }
    test {
        dataSource {
            dbCreate = "update"
            username = "root"
            password = "12345678"
            url = "jdbc:mysql://192.168.1.188:3306/traininfo?useUnicode=true&characterEncoding=utf8"
        }
    }

    production {
        dataSource {
            /* dbCreate = "update"
             username = "zthz_dxing"
             password = "zthz_dxing01"
             url = "jdbc:mysql://10.162.211.53/traininfo?useUnicode=true&characterEncoding=utf8"*/
            dbCreate = "update"
            username = "root"
            password = "12345678"
            url = "jdbc:mysql://192.168.1.188:3306/traininfo?useUnicode=true&characterEncoding=utf8"

            properties {
                maxActive = -1
                minEvictableIdleTimeMillis = 1800000
                timeBetweenEvictionRunsMillis = 1800000
                numTestsPerEvictionRun = 3
                testOnBorrow = true
                testWhileIdle = true
                testOnReturn = false
                validationQuery = "SELECT 1"
                jdbcInterceptors = "ConnectionState"
            }
        }
    }
}